<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax-01</title>
</head>
<body>
<div>
    <h1>The Ajax 01 Page</h1>
    <button onclick="doAjaxStart()">Ajax Get Request Start</button>
    <span id="result"></span>
</div>
<script>
    function doAjaxStart() {
        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4 && xhr.status == 200) {
                let result = xhr.responseText;
                document.getElementById("result").innerHTML = result;
            }
        }
        let url = "http://localhost:8080/doAjaxStart";
        xhr.open("GET", url, true);
        xhr.send(null);
    }
</script>
</body>
</html>